package com.chenfan.process.entity.dto;

import com.chenfan.process.enums.LinkedTypeEnums;
import lombok.Builder;
import lombok.Data;

import java.util.List;

/**
 * @author liuming
 * @date 2022/1/5
 */
@Data
@Builder
public class ProcessLinkedDTO {
    private List<Long> processIdList;
    private Integer linkType;
    private Long groupId;

    public Integer getType() {
        if (linkType == 0) {
            return linkType;
        }
        return LinkedTypeEnums.PARALLEL.getCode().equals(this.getLinkType()) ? LinkedTypeEnums.PARALLEL.getCode()
            : LinkedTypeEnums.SERIAL.getCode();
    }
}
